import React,{Component} from 'react';
import LazyLoad from 'react-lazyload';
import './style.scss';
export default class extends Component {
    constructor(props){
        super(props)
    }
    render() {
        return <div className='imglist'>
                  <ul>
                      {
                          this.props.imgList.map((item,index)=>{
                              return <li key={item.id} onClick={()=>{this.props.clickItem(item.id)}}>
                                  <LazyLoad className={'d'}>
                                      <div style={{backgroundImage:'url('+item.mainImg+')'}}>
                                      </div>
                                  </LazyLoad>

                                  <p>{item.name}</p>
                              </li>
                          })
                      }
                  </ul>
               </div>
    }

}